#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/types.h>

int gal_init = 1;
int gal_uninit;


int main(int argc, char* argv[], char* env[])
{
    printf("code add:%p\n",main);
    const char* str = "hello";
    int a = 0;
    static int b = 0;
    printf("int a add:%p\n",&a);
    printf("static int b add:%p\n",&b);

    printf("str add:%p\n",str);
    printf("init global add:%p\n",&gal_init);
    printf("uninit global add:%p\n",&gal_uninit);
    char* heap1 = (char*)malloc(10);
    char* heap2 = (char*)malloc(10);
    char* heap3 = (char*)malloc(10);
    char* heap4 = (char*)malloc(10);
    
    printf("heap1 add:%p\n",heap1);
    printf("heap2 add:%p\n",heap2);
    printf("heap3 add:%p\n",heap3);
    printf("heap4 add:%p\n",heap4);

    printf("stack1 add:%p\n",&heap1);
    printf("stack2 add:%p\n",&heap2);
    printf("stack3 add:%p\n",&heap3);
    printf("stack4 add:%p\n",&heap4);


    int i = 0;
    for(;i < argc; ++i)
    {
        printf("%s:%p\n",argv[i],&argv[i]);
    }
    printf("env add:%p\n",env);
    return 0;
//    char *env = getenv("MYENV");
//    if(env)
//    {
//        printf("%s\n",env);
//    }
//    return 0;

//    extern char** environ;
//    int i = 0;
//    for(; environ[i]; ++i)
//    {
//        printf("environ[%d]:%s\n",i,environ[i]);
//    }
//    return 0;
}
